use chrono::{DateTime, Duration, Utc};
use chrono_tz::Asia::Shanghai;

pub fn get_current_date() -> String {
    let now= Utc::now();
    let now_shanghai = now.with_timezone(&Shanghai);
    // 修改为HTTP标准的RFC 1123日期格式（例如：Sun, 06 Nov 1994 08:49:37 GMT）
    now_shanghai.format("%a, %d %b %Y %H:%M:%S GMT").to_string()
}

// 新增函数：生成今天加十天的UTC日期
pub fn get_current_date_plus_ten_days() -> String {
    let now = Utc::now();
    let now_plus_ten_days = now + Duration::days(10);
    let now_shanghai = now_plus_ten_days.with_timezone(&Shanghai);
    now_plus_ten_days.format("%a, %d %b %Y %H:%M:%S GMT").to_string()
}